#include <QApplication>
#include <iostream>

#include "Route.h"



int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

        double   x, y, z, r, p, j;
        s_route  traektor;
     QVector<s_point3d> dots;
        int      q=0;

    std::cout << "Input x0\n";
    std::cin >> traektor.x0;
    std::cout << "Input y0\n";
    std::cin >> traektor.y0;
    std::cout << "Input z0\n";
    std::cin >> traektor.z0;
    std::cout << "Input vx\n";
    std::cin >> traektor.vx;
    std::cout << "Input vy\n";
    std::cin >> traektor.vy;
    std::cout << "Input vz\n";
    std::cin >> traektor.vz;
    std::cout << "Input ax\n";
    std::cin >> traektor.ax;
    std::cout << "Input ay\n";
    std::cin >> traektor.ay;
    std::cout << "Input az\n";
    std::cin >> traektor.az;
    std::cout << "Input r0\n";
    std::cin >> traektor.r0;
    std::cout << "Input p0\n";
    std::cin >> traektor.p0;
    std::cout << "Input j0\n";
    std::cin >> traektor.j0;
    std::cout << "Input vr\n";
    std::cin >> traektor.vr;
    std::cout << "Input vp\n";
    std::cin >> traektor.vp;
    std::cout << "Input vj\n";
    std::cin >> traektor.vj;
    std::cout << "Input ar\n";
    std::cin >> traektor.ar;
    std::cout << "Input ap\n";
    std::cin >> traektor.ap;
    std::cout << "Input aj\n";
    std::cin >> traektor.aj;

    for( double t=0; t < 1; t = t + 0.1)
    {
        s_point3d   p;
    p.X = traektor.x0 + traektor.vx*t + traektor.ax*t*t;
    p.Y = traektor.y0 + traektor.vy*t + traektor.ay*t*t;
    p.Z = traektor.z0 + traektor.vz*t + traektor.az*t*t;
    dots.push_back( p );
    }

    if (!QGLFormat::hasOpenGL()) {
        std::cerr << "This system has no OpenGL support" << std::endl;
        return 1;
    }

    Route route( dots );
    route.setWindowTitle(QObject::tr("Route"));
    route.resize(500, 500);
    route.show();

return a.exec();
}




